'''
Created on May 12, 2011

@author: bruk
'''
import Logic
import Settings

class Camera:
    def __init__(self, posx=0, posy=0, active = 1, offset = [Settings.CAMERA_OFFSET_X,Settings.CAMERA_OFFSET_Y]):
        self.Position = [posx,posy]
        self.Active = active
        self.MovementSpeed = 1
        self.Velocity = [0,0]
        self.Offset = offset
        
    def TrackTo(self,dest):
        Logic.GhostTrackTo(self, dest, 20)
    
    def TransformToScreen(self, object):
        x = (self.Position[0] - object.Position[0]) * -1
        y = (self.Position[1] - object.Position[1]) * -1

        x += self.Offset[0]
        y += self.Offset[1]
            
        return [x,y]

    def Think(self):
        self.Position[0] += self.Velocity[0]
        self.Position[1] += self.Velocity[1]